package com.ligure.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/demo")
public class HelloController {
    @Value("${server.port}")
    private String serverPort;

    @Value("${env.port}")
    private String envPort;

    @GetMapping("/hello")
    public String hello() {
        return "I'm " + serverPort + ", Hello consumer!";
    }

    @GetMapping("/env")
    public String env() {
        return "I'm " + envPort + ", Hello consumer!";
    }
}